]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceView: Make sure to scale the workspace proportionally
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 12 Mar 2011 00:03:20 +0000 (19:03 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 15 Mar 2011 17:28:38 +0000 (13:28 -0400)
Commit 0207f1f29b776ae5f8f59321284f1adc2f85159e landed a new
way of zooming, but was causing all sorts of window positioning
weirdness because the positions were supposed to be working against
a proportional workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=644542

js/ui/workspacesView.js

index 3f79ec8c3c2b6f144cc3d618296a949ad9a4cd82..2d63ed1b67abea28a47effebccbb78022de50de3 100644 (file)
@@ -708,8 +708,11 @@ WorkspacesDisplay.prototype = {
         if (!this.workspacesView)
             return;
 
-        let width = this.actor.allocation.x2 - this.actor.allocation.x1;
-        let height = this.actor.allocation.y2 - this.actor.allocation.y1;
+        let fullWidth = this.actor.allocation.x2 - this.actor.allocation.x1;
+        let fullHeight = this.actor.allocation.y2 - this.actor.allocation.y1;
+
+        let width = fullWidth;
+        let height = fullHeight;
 
         let [controlsMin, controlsNatural] = this._controls.get_preferred_width(height);
         let controlsVisible = this._controls.get_theme_node().get_length('visible-width');
@@ -728,6 +731,9 @@ WorkspacesDisplay.prototype = {
                 x += controlsVisible;
         }
 
+        height = (fullHeight / fullWidth) * width;
+        y += (fullHeight - height) / 2;
+
         this.workspacesView.setGeometry(x, y, width, height);
     },